Skip to content

Add PACE and several bug fixes into Gwaihir branch - #1

Open
DiyouS wants to merge 13 commits into
diyou/gwaihirfrom
smazzola/konark
Open

Add PACE and several bug fixes into Gwaihir branch#1
DiyouS wants to merge 13 commits into
diyou/gwaihirfrom
smazzola/konark

Conversation

@DiyouS

@DiyouS DiyouS commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

This PR mainly

  • fixes some bugs (e.g., disable ZeroRegZero in FP regfile, add correct lsu_qmcast_i casting in FP LSU, fix FP scalar ops in Spatz controller)
  • enhance bender support (fix package name)
  • enable Double BW mode (add double bw vlsu to bender)
  • backport PRs hw: fix double bw vlsu spatz#100 and hw: comb loop fix double bw vlsu spatz#106 from upstream Spatz Cluster
  • backport commits 32d90b1a, 502724e8, 700a810f, c919d7e3 from upstream Spatz Cluster (VLSU retirement-gating and indexed-store fix), for both normal VLSU and double-bw VLSU
  • further bugfix in double-bw VLSU causing index-read starvation deadlock

Two important notes:

  • currently some parameters are given through defines (not only through json cfg!!!): remember to also set them from your top-level module (e.g., with -D define_name in your bender flow), rather than only the json cfg. The define needed for doublebw mode is DOUBLE_BW. More define also need to be set to correctly configure the whole RTL at compile time: BUF_FPU, VLEN, N_FPU, N_IPU, RVF. These defines have to match the same value of the cfg (or just be defined, for True/False values). I would still suggest, for the future, to move towards a json-only (or defines-only, through bender targets) flow, rather than a mixed one.
  • PACE does not support nor need Double BW mode, so even when enabled it still uses only a single memory channel (see commit c627539)

sermazz and others added 7 commits June 19, 2026 14:30
Currently some parameters are also given through defines, remember to also set them from your top-level module, rather than only the cfg. The define needed for doublebw mode is DOUBLE_BW. More define also need to be set to correctly configure the whole RTL at compile time, at least until the whole buildflow is moved to full json cfg, rather than mixed json-cfg+defines: BUF_FPU, VLEN, N_FPU, N_IPU, RVF. These defines have to match the same value of the cfg
- Disable ZeroRegZero in FP regfile (FP reg 0 does not need to be zeroed; zeroing creates issues which the compiler does not expect)
- Add lsu_qmcast_i input to FP LSU: its absence was corruptin L/S transactions from Spatz
- Fix amo assignment (purely cosmetic)
Backports two upstream pulp-platform/spatz double-bandwidth VLSU fixes that
are missing from this fork:

- pulp-platform/spatz#100 (pulp-platform/spatz#100) --
  synchronize commits from both VLSU interfaces (commit-together,
  vrf_commit_waiting/vrf_commit_bypass, vlsu_buf_full_i), controller
  chaining refactor, and strided-load address generation.
- pulp-platform/spatz#106 (pulp-platform/spatz#106) --
  fix a combinatorial loop in the double-bw VLSU (write_request_vlsu uses
  VLSU_VD_WD0 only).

Note: PR#100's "fix write pending check" commit is omitted as it targets a
write_pending/store_count code path that does not exist in this fork.
Comment thread hw/src/spatz.sv
`else
localparam int unsigned PaceBufWidth = N_FU * ELEN;
`endif
localparam int unsigned PaceLdIdx = VLSU_VD_WD0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess PaceLdIdx could be initialized within the above ifdef? and so only PaceLdIdx need to be used in later code.

sermazz added 5 commits July 9, 2026 16:45
Backports from pulp-platform/spatz:

- 32d90b1a "fix a potential bug in VLSU that the index counter might be
  false triggered because of the late acceptance of an indexed store"
- 502724e8 "add conservative switch from store to load instruction"

These are required for the following fetch-logic fix to actually work:
without retirement correctly gated on outstanding writes, the newer
index-fetch-pending logic has nothing to prevent a premature retire/
re-run from racing ahead of it.
… #c919d7e3)

Backports two upstream pulp-platform/spatz fixes for indexed vector
memory ops (vsuxei/vluxei):

- 700a810f "fix next index fetch logic"
- c919d7e3 "fix index fetch logic from VRF"

The index-fetch mechanism itself was fetching correct content every
group, but the send path could pair a store with a stale
one-group-behind snapshot of the index word even though the correct
word had already been fetched (data/index pairing desync at send time,
not a fetch-timing bug).
Root cause: vrf_re_o[intf][1] = mem_is_indexed was asserted
unconditionally for the whole duration of an indexed instruction,
regardless of whether that particular interface still had elements
left to process. Once one interface finished, it kept re-requesting
the shared index-VRF read port every cycle for no reason, permanently
winning arbitration against the other interface's still-needed
request and starving it of vrf_rvalid_i forever.

Fix: gate the index-read request on |mem_operation_valid[intf] too, so
a finished interface stops contending for the port. The data-read port
(vrf_re_o[intf][0], used by stores) was already correctly gated on
commit_operation_valid[intf].
For VFU/VSLDU write ports, done_result_d[intID] is latched sticky once
vl_cnt crosses a completion threshold (spatz_controller.sv, the
"VFU and VSLDU" branch). For VLSU write ports (SB_VLSU_VD_WD0/WD1),
the mirrored "VLSU: intID is fixed per interface" branch sets
wrote_result_d (a single-cycle pulse tied directly to the write) but
never sets done_result_d at all.
A chained consumer's read gate can then only ever pass by having its
read evaluated on the exact same cycle the producer's wrote_result_q
pulses; if that doesn't line up (as with a tiny vl=4 unit-stride load,
which can complete in a single beat on one interface), the read either
stalls forever or gets granted against unwritten/stale VRF read data,
propagating X into the consumer.

Fix: add a per-interface completion counter (vlsu_vl_cnt_q/d) tracking
each VLSU interface's own write progress independently (interfaces
write in parallel under double_bw, unlike VFU/VSLDU's single
sequential vl_cnt), and latch done_result_d sticky once an interface's
share is fully written. Written as (cnt + size >= max) rather than
(cnt >= max - size) since vl_max can be smaller than a single
VRFWordBWidth write for small vl, which would underflow the subtracted
form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants